﻿@{
    ViewBag.Title = "设备信息";
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>登录</title>
    <script src="~/Scripts/jquery-2.1.1.min.js"></script>
    <script src="~/Scripts/bootstrap-table-min.js"></script>
    <script src="~/Scripts/bootstrap-table-zh-CN.min.js"></script>
    <script src="~/Scripts/bootstrapValidator.min.js"></script>
    <script src="~/Scripts/zh_CN.js"></script>
    <script src="//cdn.bootcss.com/bootstrap-select/2.0.0-beta1/js/bootstrap-select.js"></script>
    <script src="//cdn.bootcss.com/bootstrap-select/2.0.0-beta1/js/i18n/defaults-zh_CN.js"></script>
    <link href="//cdn.bootcss.com/bootstrap-select/2.0.0-beta1/css/bootstrap-select.css" rel="stylesheet" />
    <script src="~/Scripts/bootstrap.min.js"></script>
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Scripts/bootstrap-table.min.css" rel="stylesheet" />
    <link href="~/Content/bootstrapValidator.min.css" rel="stylesheet" />
    <script src="~/Scripts/Equipment.js"></script>
</head>
<body style="padding:10px">
    <div id="toolbar" class="btn-group">
        <form id="formSearch" class="form-horizontal" onkeydown="entersearch()" style="width:1000px;">
            <label class="control-label col-sm-1" for="txt_search_id" style="width: 14%;">设备编号</label>
            <div class="col-sm-3" style="width:18%;">
                <input type="text" class="form-control" id="txt_search_id">
            </div>
            <div class="col-sm-3" style="width:26%;">
                <input type="text" class="form-control" id="keyword" value="">
            </div>
            <div class="col-sm-4" style="text-align:left; width:10%;">
                <button type="button" id="btn_query" class="btn btn-primary" onclick="query()">查询</button>
            </div>
        </form>
        @{
            if (HttpContext.Current.User.IsInRole("admin"))
            {
                <button id="btn_add" type="button" class="btn btn-default" onclick="Editform('add',null)">
                    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
                </button>
                @*<button id="btn_edit" type="button" class="btn btn-default" onclick="Editform('alert')">
                        <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改
                    </button>*@
                <button id="btn_delete" type="button" class="btn btn-default" onclick="Delcfm()">
                    <span class=" glyphicon glyphicon-remove" aria-hidden="true">
                    </span>一键删除
                </button>
            }
        }
    </div>
    <table id="table">
        <thead>
            <tr>
                <th>编号</th>
                <th>名称</th>
                <th>型号</th>
                <th>尺寸</th>
                <th>出品商</th>
                <th>生产日期</th>
                <th>购买日期</th>
                <th>保修截至日期</th>
                <th>状态</th>
            </tr>
        </thead>
    </table>
    <!-- 增加修改 -->
    <div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <center><h4 class="modal-title" id="myModalLabel">维修设备详情</h4></center>
                </div>
                <div class="container">
                    <div class="row clearfix">
                        <div class="col-md-6">
                            <form role="form" id="addform" class="form-horizontal">
                                <div class="form-group">
                                    <label for="ID" class="col-sm-3 col-md-3 col-lg-3 control-label">设备编号</label>
                                    <div class="col-sm-8 col-md-8 col-lg-8">
                                        <input type="text" class="form-control" id="ID" name="ID">
                                    </div>
                                </div>
                                <div class="form-group ">
                                    <label for="Name" class="col-sm-3 col-md-3 col-lg-3 control-label">设备名</label>
                                    <div class="col-sm-8 col-md-8 col-lg-8">
                                        <input type="text" class="form-control" id="Name" name="Name">
                                    </div>

                                </div>
                                <div class="form-group">
                                    <label for=" user" class="col-sm-3 col-md-3 col-lg-3 control-label">使用者</label>
                                    <div class="col-sm-8 col-md-8 col-lg-8">
                                        <select id="User" class="selectpicker form-control" data-live-search="true" title="--请选择--"></select>
                                    </div>

                                </div>
                                <div class="form-group">
                                    <label for="Type" class="col-sm-3 col-md-3 col-lg-3 control-label">类型</label>
                                    <div class="col-sm-8 col-md-8 col-lg-8">
                                        <select id="Type" class="form-control" name="Model"></select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="Model" class="col-sm-3 col-md-3 col-lg-3 control-label">型号</label>
                                    <div class="col-sm-8 col-md-8 col-lg-8">
                                        <input type="text" class="form-control" id="Model" name="Model">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="Price" class="col-sm-3 col-md-3 col-lg-3 control-label">价格</label>
                                    <div class="col-sm-8 col-md-8 col-lg-8">
                                        <input type="text" class="form-control" id="Price" name="Price">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="Position" class="col-sm-3 col-md-3 col-lg-3 control-label">所在位置</label>
                                    <div class="col-sm-8 col-md-8 col-lg-8">
                                        <input type="text" class="form-control" id="Position" name="Position">
                                    </div>

                                </div>
                                <div class="form-group">
                                    <label for="Status" class="col-sm-3 col-md-3 col-lg-3 control-label">状态</label>
                                    <div class="col-sm-8 col-md-8 col-lg-8">
                                        <select class="form-control" id="Status" name="Status">
                                            <option>--请选择--</option>
                                            <option value="可用">可用</option>
                                            <option value="不可用">不可用</option>
                                        </select>
                                    </div>

                                </div>
                                <div class="form-group">
                                    <label for="ManuFacturers" class="col-sm-3 col-md-3 col-lg-3 control-label">厂商</label>
                                    <div class="col-sm-8 col-md-8 col-lg-8">
                                        <input type="text" class="form-control" id="ManuFacturers" name="ManuFacturers">
                                    </div>

                                </div>
                                <div class="form-group">
                                    <label for="Buytime" class="col-sm-3 col-md-3 col-lg-3 control-label">购买时间</label>
                                    <div class="col-sm-8 col-md-8 col-lg-8">
                                        <input type="date" class="form-control" id="Buytime" name="Buytime">
                                    </div>

                                </div>
                                <div class="form-group">
                                    <label for="Warranty" class="col-sm-3 col-md-3 col-lg-3 control-label">截至日期</label>
                                    <div class="col-sm-8 col-md-8 col-lg-8">
                                        <input type="date" class="form-control" id="Warranty" name="Warranty">
                                    </div>
                                </div>
                                <div class="row clearfix" style=" margin-left: 20%;">
                                    <div class="col-md-2">
                                        <button type="button" class="btn  btn-primary" id="btnSubmit" onclick="Editrecord()">提交</button>
                                    </div>
                                    <div class="col-md-2">
                                        <button type="reset" class="btn btn-default" style="margin-left:100px;">重置</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <!-- 信息提醒 -->

    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title" id="myModalLabel">提示</h4>
                </div>
                <div class="modal-body">
                    <center id="Message"> ...</center>
                </div>
                <div class="modal-footer">
                    <center> <button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button></center>
                </div>
            </div>
        </div>
    </div>



    <!-- 信息删除确认 -->
    <div class="modal fade" id="delcfmModel">
        <div class="modal-dialog">
            <div class="modal-content message_align">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <h4 class="modal-title">提示信息</h4>
                </div>
                <div class="modal-body">
                    <center><h4>您确认要删除吗？</h4></center>
                </div>
                <div class="modal-footer">
                    <center>
                        <a onclick="Dte()" class="btn btn-success" data-dismiss="modal">确定</a>
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    </center>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</body>
</html>
